package mylibrary.httpclient.v4;

import java.io.IOException;

import org.apache.http.HttpResponse;
import org.apache.http.StatusLine;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;

public class TTT {

	public static void main(String[] args) throws Exception {
		
		System.setProperty("javax.net.ssl.trustStore", "D:\\My_Self_Signed_CA\\truststore");
	    System.setProperty("javax.net.ssl.trustStorePassword", "password1");
	    
	    
	    //System.setProperty("javax.net.ssl.keyStoreType", "pkcs12");
	    System.setProperty("javax.net.ssl.keyStore", "D:\\My_Self_Signed_CA\\client.jks");
	    System.setProperty("javax.net.ssl.keyStorePassword", "password1");
	    
	    HttpResponse localHttpResponse = new DefaultHttpClient().execute(new HttpGet("https://192.168.2.120:8443/qiyexuexi/index.do?method=index"));
		StatusLine localStatusLine = localHttpResponse.getStatusLine();
		System.out.println(localStatusLine.getStatusCode());
	}
}
